<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
                      "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
  <head> 
    <title>Capture Photo</title> 
 
    <script type="text/javascript" charset="utf-8" src="phonegap.js"></script> 
    <script type="text/javascript" charset="utf-8"> 
 
    var root = this;  
 
    function onLoad() 
    { 
        document.addEventListener("deviceready",onDeviceReady,false); 
    } 
 
    function onDeviceReady()
	{
		var cb = ChildBrowser.install();
		if(cb != null)
		{
			cb.onLocationChange = function(loc){ root.locChanged(loc); };
			cb.onClose = function(){root.onCloseBrowser()};
			cb.onOpenExternal = function(){root.onOpenExternal();};	
		}
	}

	function onCloseBrowser()
	{
		var element = document.getElementById('result'); 
        element.innerHTML += 'onCloseBrowser()<hr />';
	}
	
	function locChanged(loc)
	{
		var element = document.getElementById('result'); 
        element.innerHTML += 'locChanged( '+ loc +' )<hr />';
	}
	
	function onOpenExternal()
	{
		var element = document.getElementById('result'); 
        element.innerHTML += 'onOpenExternal()<hr />';
	}
 
    function makeChild(message) 
    {  
        window.plugins.childBrowser.showWebPage(message);
    } 
 
    </script> 
  </head> 
  <body onload="onLoad()"> 
    <button onclick="makeChild('http://www.naver.com');">Naver</button><br> 
    <button onclick="makeChild('file:///Res/index.html');">PhoneGap</button><br> 
    <p id="result"></p>
  </body> 
</html> 